#include <stdio.h>
#include <conio.h>


void main(void)
{

	int vector[20]={0},i=0,j=0,aux=0;
	clrscr();
	for (i=0;i<20;i++)
	{
		printf ("Ingrese valor distinto a 0: ");
		scanf ("%d",&vector[i]);
		while (vector[i] == 0)
		{
		printf ("El valor tiene que ser distinto a 0: ");
		scanf ("%d ",&vector[i]);
		}
	}

	printf ("\nLos valores fueron ingresados en el orden de: ");
	for (i=0;i<20;i++)
		printf ("%d, ",vector[i]);

	for (i=0;i<20;i++)
		for (j=i+1;j<20;j++)
			if (vector[i]>0)
			{
			aux=vector[i];
			vector[i]=vector[j];
			vector[j]=aux;
			}
	for (i=0;i<20;i++)
		for (j=i+1;j<20;j++)
			if (vector[i]>0 && vector[j]>0 && vector[i]<vector[j])
			{
				aux=vector[i];
				vector[i]=vector[j];
				vector[j]=aux;
			}
	for (i=0;i<20;i++)
		for (j=i+1;j<20;j++)
			if (vector[i]<0 && vector[j]<0 && vector[i]>vector[j])
			{
				aux=vector[i];
				vector[i]=vector[j];
				vector[j]=aux;
			}

	printf ("\nEl vector ordenado quedo: ");
	for (i=0;i<20;i++)
		printf ("%d, ",vector[i]);

	getch();
}